//
//  BaseViewController.h
//  BossSystem
//
//  Created by hzyd-wlj on 14-6-23.
//  Copyright (c) 2014年 hzyd-wlj. All rights reserved.
//


#import <UIKit/UIKit.h>
#import "Define.h"
#import "SVHTTPClient.h"
#import "SVProgressHUD.h"
#import "HttpRequestManager.h"
#import "BaseNavController.h"
#import "UIView+Positioning.h"
#import "UIScrollView+SVPullToRefresh.h"
#import "UIScrollView+SVInfiniteScrolling.h"
#import "RIButtonItem.h"
#import "UIAlertView+Blocks.h"
#import "UIColor+FlatUI.h"

@interface BaseViewController : UIViewController

#pragma mark -数据相关
/**
 *  当前的 User
 *
 */
-(NSString *)userID;
//- (void)changeCurrentUser:(User *)currentUser;

/**
 *  更改当前用户选择的University
 *
 *  @param university
 */
//- (void)changeUserUniversity:(University *)university;

#pragma mark -导航栏相关
//导航栏相关,注:只有在导航栏左或右边有且仅有一个的时候，才能使用。
- (void)addBackButton;
- (void)addLeftButtonWithImage:(UIImage *)image actionBlock:(void(^)(void))block;
- (void)addRightButtonWithImage:(UIImage *)image actionBlock:(void(^)(void))block;
- (void)addRightButtonWithTitle:(NSString *)title actionBlock:(void(^)(void))block;

//需要重载
- (void)setUpNavgationBar;

#pragma mark - CoreData相关
/**
 *  CoreData保存操作
 *
 *  @return BOOL
 */
- (BOOL)saveInDefaultObjectContext;
- (NSManagedObjectContext *)defaultObjectContext;

- (NSArray *)fetchEntityForName:(NSString *)entityName inDefaultMOCWithPredicateFormat:(NSString *)predicateString,...;
- (NSArray *)fetchEntityForName:(NSString *)entityName inManagedObjectContext:(NSManagedObjectContext *)moc WithPredicateFormat:(NSString *)predicateString, ...;
/**
 *  新建一个backgroundObjectContext
 *
 *  @return NSManagedObjectContext
 */
- (NSManagedObjectContext *)newBackgroundObjectContext;
@end
